import com.sun.jmx.remote.internal.ArrayQueue;

import java.util.Queue;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.SynchronousQueue;

/**
 * Created by Administrator on 2016/7/9.
 */
public class Test {

    public static void main(String[] args) throws InterruptedException {
        LinkedBlockingQueue<String> queue = new LinkedBlockingQueue<String>();
        for (int i = 0; i < 10; i++) {
            queue.offer("Task" + i);
        }
        final Task task = new Task(queue);
        new Runnable(){
            @Override
            public void run() {
                task.run();
            }
        }.run();
        System.err.println("ssss");
        for (int i = 10; i < 20; i++) {
            task.addJob("Task" + i);
        }
    }

}
